package com.qf.taobei.entity.vo;


/**
 * @author Ran
 * @since JDK 1.8
 *      响应对象
 */
public class RespBean {
    private int status;
    private String msg;//提示语句
    private Object data;//数据

    public RespBean() {
    }

    public RespBean(int status, String msg, Object data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }
    //响应成功，携带提示语句与数据
    public static RespBean respSuccess(String msg,Object data){
        return new RespBean(200,msg,data);
    }

    //响应成功，携带提示语句
    public static RespBean respSuccess(String msg){
        return new RespBean(200,msg,null);
    }

    //响应失败，携带提示语句与数据
    public static RespBean respError(String msg,Object data){
        return new RespBean(500,msg,data);
    }

    //响应失败，携带提示语句
    public static RespBean respError(String msg){
        return new RespBean(500,msg,null);
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
